package com.hqq.behaviour.specification.selector;

import com.hqq.behaviour.specification.creature.Creature;
import com.hqq.behaviour.specification.property.Movement;

import java.util.function.Predicate;

/**
 * MovementSelector
 * Created by heqianqian on 2017/6/20.
 */
public class MovementSelector implements Predicate<Creature> {

    private final Movement movement;

    public MovementSelector(Movement movement) {
        this.movement = movement;
    }

    @Override
    public boolean test(Creature creature) {
        return creature.getMovement().equals(movement);
    }
}
